//package com.shopnight.controller;
//
//import com.shopnight.entity.User;
//import com.shopnight.mapper.UserMapper;
//import com.shopnight.service.UserService;
//import io.swagger.annotations.Api;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.ArrayList;
//import java.util.List;
//
//@RestController
//@RequestMapping("/test")
//@Api(tags = {"testController"},description = "c测试接口")
//public class testController {
//
//    @Autowired
//    public UserService userService;
//    @GetMapping("/test1")
//    public void test1(){
//        List<User> users = userService.list(null);
//        List<User> users2 = new ArrayList<User>();
//        users.forEach(user->{
//            if(user.getUserNick().length() == 0){
//                user.setUserNick("用户" +  user.getPhonenumber().substring( user.getPhonenumber().length() - 4) );
//                System.out.println("user = " + user);
//            }
//            if(user.getAvatar() == null || user.getAvatar() == ""){
//                user.setAvatar("https://ejxy.oss-cn-hangzhou.aliyuncs.com/user/2023-06-26/1687714897140.jpg");
//                System.out.println("user = " + user);
//            }
//        });
//
//        userService.updateBatchById(users);
//    }
//
//
//}
